<?php

class Model_Orm_User_Tests extends \PHPUnit_Framework_TestCase
{
    public static function tearDownAfterClass()
    {
        Auth::delete_user('john07');
    }
    
    public function test_usr_1() {
        try {
            \Auth::create_user(
                'john07',               // username
                'mysecurepassw0rd',     // password
                'john@gmail.com',   // email
                1,
                array(
                    'first_name' => 'John',
                    'last_name' => 'Doe',
                    'language' => 'en'
                )
            );
        } catch (Exception $ex) {
            echo "ERROR [USR 1]: Couldn't create new user!";
        }
    }
    
    public function test_usr_2() {
        try {
            Auth::update_user(array(
                'email' => 'john.doe@gmail.com',
                'password' => 'M0RE_SecuRePwd',
                'old_password' => 'mysecurepassw0rd'
            ), 'john07');   
        } catch (Exception $ex) {
            echo "ERROR [USR 2]: Couldn't edit existing user!";
        }
    }
}

